

//mongoose: Instructions  http://cw.hubwiz.com/card/c/543b2e7788dba02718b5a4bd/1/4/5/
var mongoose = require('mongoose')

var sd = require('silly-datetime')

mongoose.connect('mongodb://localhost/users_face')

var Schema = mongoose.Schema

var date = sd.format(new Date(), 'YYYY-MM-DD HH:mm:ss')

var userSchema = new Schema({
    Name:{
        type: String,
        required: true
    },
    Department:{
        type: String,
        default:'ATMO-3CN/ENG2'
    },
    Created_time:{
        type: String,
        default: date
    },
    Status :{
        type: String,
        default: "人脸识别成功"
    },
    Image :{
        type:String,
        default: "public/img/user.jpg"
    }
    
})

module.exports = mongoose.model('Test', userSchema,'Test')

